<?php

#namespace MyFrame\Component\Http;

class Request
{
    public $serverName ;
    public $serverPort ;
    public $pathInfo ;
    public $method;
    public $documentRoot;

    public $query;

    public function __construct()
    {
        $this->serverName = $_SERVER['SERVER_NAME'];
        $this->serverPort = $_SERVER['SERVER_PORT'];
        $this->pathInfo = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO']: $_SERVER['REQUEST_URI'];
        $this->method = $_SERVER['REQUEST_METHOD'];

        $this->documentRoot = $_SERVER['DOCUMENT_ROOT'];

        $this->query = $_REQUEST;
    }

    public function mergeQuery($array)
    {
      $this->query = array_merge($this->query, $array);
    }
}
